<template>
	<view class="wrap">
		<view class="listItem spaceBet"
			v-for="(item,index) in focList"
			:key="index"
			@tap="goDetInfo(index)"
		>
			<block v-if="focType == 'zxs'">
				<view class="itemImg spec posRel defBg">
					<image class="samePar posAbso ltzero" :src="getCloudFilePath(item.zxsPortrait)" mode="aspectFill" lazy-load></image>
				</view>
				<view class="itemCon">
					<view class="itemTit">{{item.zxsRealName}}咨询师</view>
					<view class="fields clearfix">
						<view class="comTagsBor"
							v-for="(innerItem,innerIndex) in arrayFuns((item.scRange || ''),',')"
							:key="innerIndex"
						>{{innerItem}}</view>
					</view>
					<view class="bot hasFlex">
						<view class="priceNum">¥{{item.serviceFee}}/次</view>
						<view>{{item.scNum}}人关注</view>
					</view>
				</view>
			</block>
			<block v-else>
				<view class="itemImg posRel defBg">
					<image class="samePar posAbso ltzero" :src="getCloudFilePath(item.headImg)" mode="aspectFill" lazy-load></image>
				</view>
				<view class="itemCon">
					<view class="itemTit">{{item.ogzName}}</view>
					<view class="fields multiEllip clamp2">地址:{{item.address}}</view>
					<view class="bot">{{item.gzNum}}人关注</view>
				</view>
			</block>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			focType:String,
			focList:Array
		},
		computed:{
			arrayFuns(){
				return function(str,splitQuote){
					var tmpArr = str.split(splitQuote);
					return tmpArr;
				}
			}
		},
		methods:{
			goDetInfo(index){
				this.$emit('goDetInfo',index)
			}
		}
	}
</script>

<style lang='scss' scoped>
	.comTagsBor{
		float: left;
		margin-right: 10rpx;
		margin-bottom: 10rpx;
	}
	.listItem{
		padding: 20rpx;
		background: #fff;
		border-radius: 20rpx;
		margin-bottom: 20rpx;
		.itemCon{
			width: 80%;
			min-height: 140rpx;
			font-size: $font-size26; 
			color: $pss-text-color8;
			.itemTit{
				font-size: $font-size30;
				color: $pss-text-color3;
				margin-bottom: 5rpx;
			}
			.bot{
				font-size: $font-size24;
				color: $pss-text-colora;
				align-items: center;
				margin-top: 10rpx;
				.priceNum{
					font-size: $font-size32;
					color: $pss-color-red;
					margin-right: 50rpx;
				}
			}
		}
		.itemImg{
			width: 140rpx;
			height: 140rpx;
			margin-right: 20rpx;
			flex-shrink: 0;
			display: flex;
			justify-content: center;
			align-items: center;
			border-radius:10rpx;
			.samePar{
				z-index: 2;
				border-radius:10rpx;
			}
			&.spec{
				height: 180rpx;
			}
		}
	}
	.wrap{
		padding: 0 30rpx;
	}
</style>